<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;

class Down extends Controller
{
    public function index()
    {
        $down = new Excel();
        $title = ['序号', '曲目','组别','选手','联系方式'];
        $list = Db::name('sign')->where('enable',2)->select();
        $data = '';
        foreach($list as $key => $val) {
            $data[$key][] = $val['id'];
            $data[$key][] = $val['song'];
            $data[$key][] = $val['grp'];
            $data[$key][] = $val['player'];
            $data[$key][] = $val['phone'];
        }
        $down->downLoad($title,$data,'报名表');
    }
}